$(function(){
	loadAdminNoticeMessage();
})
function loadAdminNoticeMessage(){
	utilAjax('/notice_admin/queryByNoticeWhereState','','post',
			function(data){
		var noticeMsg = '';
		$.each(data.list,function(i,n){
			var date = new Date(n.notice_create_time);//时间戳为10位需*1000，时间戳为13位的话不需乘1000
			Y = date.getFullYear() + '-';
			M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date
					.getMonth() + 1)
					+ '-';
			D = date.getDate() + ' ';
			noticeMsg += "<br />"+
					"<div class='notice-div'>"+
						"<div class='right-div' onmouseover='noticeHover("+i+")' onmouseout='noticeHovers("+i+")'>"+
							""+Y + M + D+""+
						"</div>"+
						"<table id='body-div-"+i+"' align='center' cellpadding='0' cellspacing='20' class='notice' onmouseover='noticeHover("+i+")' onmouseout='noticeHovers("+i+")'>"+
							"<tr><td>"+
									"<font class='notice-title'>"+n.notice_title+" <hr></font>"+
								"</td></tr>"+
							"<tr><td>"+n.notice_content+"<br><br></td></tr>"+
						"</table>"+
					"</div>"+
					"<br /><br /><br />";
		})
		$("#noticeMsg").html(noticeMsg);
	});
}



function utilAjax(url,data,type,success){
	$.ajax({
		url:url,
		data:data,
		dataType:'json',
		type:type,
		success:success,
		error:function(){
		}
	});
}

function dateUtil(times){
	var date = new Date(times);//时间戳为10位需*1000，时间戳为13位的话不需乘1000
	Y = date.getFullYear() + '-';
	M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date
			.getMonth() + 1)
			+ '-';
	D = date.getDate() + ' ';
	var dateCon = Y + M + D;
	return dateCon;
}



function noticeHover(op){
	$('#body-div-'+op).css('box-shadow','0 10px 10px 0 rgba(0,0,0,0.5)');
}
function noticeHovers(op){
	$('#body-div-'+op).css('box-shadow','none');
}

